﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:SoundPlayer="clr-namespace:jSLApp.Client.Controls.SoundPlayer" xmlns:WinControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" xmlns:sdk="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data" xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection;assembly=jSLCore.Client.Presentation" xmlns:Controls="clr-namespace:jSLApp.Client.Controls">
    <Style TargetType="Selection:SelectableGrid">
        <Setter Property="AutoGenerateColumns" Value="False"/>
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="RowBackground" Value="#00EAEFF4"/>
        <Setter Property="AlternatingRowBackground" Value="#31000000"/>
        <Setter Property="RowStyle">
            <Setter.Value>
                <Style TargetType="WinControls:DataGridRow">
                    <Setter Property="IsTabStop" Value="False"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="WinControls:DataGridRow">
                                <sdk:DataGridFrozenGrid x:Name="Root">
                                    <sdk:DataGridFrozenGrid.Resources>
                                        <Storyboard x:Key="DetailsVisibleTransition">
                                            <DoubleAnimation Duration="00:00:0.1" Storyboard.TargetProperty="ContentHeight" Storyboard.TargetName="DetailsPresenter"/>
                                        </Storyboard>
                                    </sdk:DataGridFrozenGrid.Resources>
                                    <sdk:DataGridFrozenGrid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </sdk:DataGridFrozenGrid.ColumnDefinitions>
                                    <sdk:DataGridFrozenGrid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </sdk:DataGridFrozenGrid.RowDefinitions>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal"/>
                                            <VisualState x:Name="NormalAlternatingRow">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="0.09" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="NormalSelected">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="MouseOverSelected">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="0.09" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="UnfocusedSelected">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle"/>
                                                    <ColorAnimation Duration="0" To="#FFE1E7EC" Storyboard.TargetProperty="(Fill).Color" Storyboard.TargetName="BackgroundRectangle"/>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="UnfocusedEditing"/>
                                            <VisualState x:Name="NormalEditing"/>
                                            <VisualState x:Name="MouseOverUnfocusedEditing"/>
                                            <VisualState x:Name="MouseOverEditing"/>
                                            <VisualState x:Name="MouseOverUnfocusedSelected"/>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="ValidationStates">
                                            <VisualState x:Name="Valid"/>
                                            <VisualState x:Name="Invalid">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="BackgroundRectangle">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="InvalidVisualElement"/>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Fill="#FF25C8EB" Opacity="0" Grid.RowSpan="2"/>
                                    <Rectangle x:Name="InvalidVisualElement" Grid.ColumnSpan="2" Fill="#FFF7D8DB" Opacity="0" Grid.RowSpan="2"/>
                                    <sdk:DataGridRowHeader x:Name="RowHeader" sdk:DataGridFrozenGrid.IsFrozen="True" Grid.RowSpan="3"/>
                                    <sdk:DataGridCellsPresenter x:Name="CellsPresenter" Grid.Column="1" sdk:DataGridFrozenGrid.IsFrozen="True"/>
                                    <sdk:DataGridDetailsPresenter x:Name="DetailsPresenter" Grid.Column="1" Grid.Row="1"/>
                                    <Rectangle x:Name="BottomGridLine" Grid.Column="1" HorizontalAlignment="Stretch" Height="1" Grid.Row="2"/>
                                </sdk:DataGridFrozenGrid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="CellStyle">
            <Setter.Value>
                <Style TargetType="WinControls:DataGridCell">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="IsTabStop" Value="False"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="WinControls:DataGridCell">
                                <Grid x:Name="Root" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CurrentStates">
                                            <VisualState x:Name="Regular"/>
                                            <VisualState x:Name="Current"/>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="ValidationStates">
                                            <VisualState x:Name="Valid"/>
                                            <VisualState x:Name="Invalid">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="InvalidVisualElement"/>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="SelectionStates">
                                            <VisualState x:Name="Unselected"/>
                                            <VisualState x:Name="Selected"/>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Unfocused"/>
                                            <VisualState x:Name="Focused"/>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    <Rectangle x:Name="InvalidVisualElement" HorizontalAlignment="Stretch" IsHitTestVisible="False" Opacity="0" Stroke="#FFDC000C" StrokeThickness="1" VerticalAlignment="Stretch"/>
                                    <Rectangle x:Name="RightGridLine" Grid.Column="1" VerticalAlignment="Stretch" Width="1"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
